<?php include "htmlBase/header.php"; ?>

<?php
include "ViewBase.php";
$Entidades = MontarHeadPHP("Funcionario");
MontarHeadScript("Funcionario");
?>

<div class="page">
    <div class="page-header">
        <div class="page-header-content">
            <h1><span style="padding-left:80px">Funcionário</span> <small>(Pesquisar)</small></h1>
            <a href="Index.php" class="back-button big page-back"></a>
        </div>
        <div class="progress-bar" align="rigth">
            <div class="bar bg-color-blue" style="width: 75%"></div>
        </div>
    </div>
    <br/>
    <div class="page">
        <div class="page-region">
            <div class="page-region-content">

                <table class="hovered bordered">
                    <th></th>
                    <th>Id</th>
                    <th>Nome</th>
                    <th>Login</th>
                    <th>Senha</th>
                    <th>Nível Acesso</th>

                    <?php
                    if ($Entidades == null)
                    {
                        ?>
                        <tr>
                            <td colspan="6">
                                <h3 style="text-align:center">Sem Resultado</h3>
                            </td>
                        </tr>
                        <?php
                    } else
                    {
                        foreach ($Entidades as $funcionario)
                        {
                            ?>
                            <tr onclick="Selecionar(<?php echo $funcionario->Id; ?>)">
                                <td width="1"><input type="radio" name="RadioId" Id="<?php echo $funcionario->Id; ?>" value="<?php echo $funcionario->Id; ?>"></td>
                                <td><?php echo $funcionario->Id; ?></td>
                                <td><?php echo $funcionario->Nome; ?></td>
                                <td><?php echo $funcionario->Login; ?></td>
                                <td><?php echo $funcionario->Senha; ?></td>
                                <td><?php echo $funcionario->getNomeNivelAcesso(); ?></td>
                            </tr>
                            <?php
                        }
                    }
                    ?>
                </table>

                <div class="input-control" style="margin-left: auto; margin-right: auto;">
                    <button class="standart default" onclick="Novo()">Novo</button>
                    <button class="standart" onclick="Alterar()">Alterar</button>
                    <button class="standart" onclick="Excluir()">Excluir</button>
                    <a href="Index.php" class="button standart bg-color-lighten" style="float: right">Voltar</a>
                </div>

            </div>
        </div>
    </div>

</div>

<?php include "htmlBase/footer.php"; ?>